#ifndef MNIST_H
#define MNIST_H

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define IMAGE_SIZE 784  // 28*28
#define NUM_CLASSES 10
#define HIDDEN_SIZE 128

typedef struct {
    float *input_weights;
    float *hidden_weights;
    float *input_bias;
    float *hidden_bias;
} Network;

// 函数声明
void read_mnist_data(const char* image_path, const char* label_path, 
                    float **images, unsigned char **labels, int *num_items);
Network* create_network();
void train_network(Network *net, float *images, unsigned char *labels, int num_items);
int predict(Network *net, float *image);
void free_network(Network *net);

// 新增函数声明
void print_image(float *image);
void print_probabilities(Network *net, float *image);

#endif
